package com.xjm.ips.controller.config;

import com.xjm.ips.entity.Menu;
import com.xjm.ips.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/config")
public class SysController {
    @Autowired
    MenuService menuService;

    @GetMapping("/menu")
    /**
     * 这里注意不能使用前端传过来的id去查询数据库，前端数据不可信
     * 应该从浏览器缓存中去获取
     */
    public List<Menu> getMenusByHrId(){
        return menuService.getMenusByHrId();
    }
}
